package logic

import (
	"context"
	"video-hub/model/mysql"

	"video-hub/videorpc/internal/svc"
	"video-hub/videorpc/videorpc"

	"github.com/zeromicro/go-zero/core/logx"
)

type ContentDelLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewContentDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ContentDelLogic {
	return &ContentDelLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

func (l *ContentDelLogic) ContentDel(in *videorpc.ContentDelRequest) (*videorpc.ContentDelResponse, error) {
	// todo: add your logic here and delete this line
	var comment mysql.Comment
	err := comment.CommentDel(mysql.DB, in.ContentId)
	if err != nil {
		return nil, err
	}
	return &videorpc.ContentDelResponse{}, nil
}
